<%@ Page Language="C#"    %>

<%@ Implements Interface="System.Web.UI.ICallbackEventHandler" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<script runat="server">

    public int cbCount = 0;

    // Define method that processes the callbacks on server.
    public void RaiseCallbackEvent(String eventArgument)
    {
        cbCount = Convert.ToInt32(eventArgument) + 1;
    }

    // Define method that returns callback result.
    public string GetCallbackResult()
    {
        return cbCount.ToString();
    }

    protected void Page_Load(object sender, EventArgs e)
    {
        // Define a StringBuilder to hold messages to output.
        StringBuilder sb = new StringBuilder();

        // Check if this is a postback.
        sb.Append("No page postbacks have occurred.");
        if (Page.IsPostBack)
        {
            sb.Append("A page postback has occurred.");
        }

        // Write out any messages.
        

        // Get a ClientScriptManager reference from the Page class.
        ClientScriptManager cs = Page.ClientScript;

        // Define one of the callback script's context.
        // The callback script will be defined in a script block on the page.
        StringBuilder context1 = new StringBuilder();
        context1.Append("function ReceiveServerData1(arg, context)");
        context1.Append("{");
        context1.Append("Message1.innerText =  arg;");
        context1.Append("value1 = arg;");
        context1.Append("}");

        // Define callback references.
        String cbReference1 = cs.GetCallbackEventReference(this, "arg", 
            "ReceiveServerData1", context1.ToString());
        String cbReference2 = cs.GetCallbackEventReference("'" + 
            Page.UniqueID + "'", "arg", "ReceiveServerData2", "", 
            "ProcessCallBackError", false);
        String callbackScript1 = "function CallTheServer1(arg, context) {" + 
            cbReference1 + "; }";
        String callbackScript2 = "function CallTheServer2(arg, context) {" + 
            cbReference2 + "; }";
        String callbackScript3 = "function CallTheServer3(arg, context) {" +
          cbReference1 + "; }";

        // Register script blocks will perform call to the server.
        cs.RegisterClientScriptBlock(this.GetType(), "CallTheServer1", 
            callbackScript1, true);
        cs.RegisterClientScriptBlock(this.GetType(), "CallTheServer2", 
            callbackScript2, true);
        cs.RegisterClientScriptBlock(this.GetType(), "DropDownList1_SelectedIndexChanged", callbackScript1,true);

    }
    protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
    {
        
    }
</script>

<script type="text/javascript">
    var value1 = 0;
    var value2 = 0;
    function ReceiveServerData2(arg, context) {
        Message2.innerText = arg;
        value2 = arg;
    }
    function ProcessCallBackError(arg, context) {
        Message2.innerText = 'An error has occurred.';
    }
</script>

<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
    <title>ClientScriptManager Example</title>
<script type="text/javascript" src="stmenu.js"></script></head>
<body>
    <form id="Form1" 
          runat="server">
    <div>
    </div>
    </form>






<script type="text/javascript">
<!--
stm_bm(["menu0b0f",900,"","blank.gif",0,"","",1,0,250,0,1100,1,0,0,"","",486539519,0,1,1,"default","hand","",1,25],this);
stm_bp("p0",[0,4,0,0,0,0,0,0,100,"",-2,"",-2,50,0,0,"#999999","transparent","textura4_1.gif",3,1,2,"#FA7E02 #414377 #454770 #FA7E02"]);
stm_ai("p0i0",[0,"   WORKSPACE","","",-1,-1,0,"WorkSpace.aspx","_self","","","","",0,0,0,"arrow_r.gif","",0,0,0,0,1,"#FA7E02",1,"#FA7E02",1,"","",3,3,0,0,"#CCCCCC","#CCCCCC","#FFFFFF","#FFFFFF","bold 14pt Arial Narrow","bold 14pt Arial Narrow",0,0,"","","","",0,0,0],183,30);
stm_bpx("p1","p0",[0,4,0,0,0,0,0,0,100,"",-2,"",-2,50,0,0,"#999999","#FFFFF7","",3,1,1]);
stm_aix("p1i0","p0i0",[0,"Pending","","",-1,-1,0,"","_self","","","","",0,0,0,"","",0,0,0,1,1,"#FFFFF7",1,"#FA7E02",0,"textura4_1.gif","textura4_1.gif",3,3,1,1,"#003366 #FA7E02 #FA7E02","#CCCCCC","#FFFFFF","#FFFFFF","bold 11pt Arial Narrow","bold 11pt Arial Narrow"],90,21);
stm_aix("p1i1","p1i0",[0,"Completed"],90,21);
stm_aix("p1i2","p1i0",[0,"Cancelled"],90,21);
stm_ep();
stm_ai("p0i1",[6,2,"#FA7E02","",-1,-1,0]);
stm_aix("p0i2","p0i0",[0,"   NEW ORDER","","",-1,-1,0,"OrderPlacement.aspx","_self","","","","",0,0,0,""],183,30);
stm_aix("p0i3","p0i1",[6,1]);
stm_aix("p0i4","p0i2",[0,"   SEARCH","","",-1,-1,0,"Search.aspx"],183,30);
stm_aix("p0i5","p0i1",[]);
stm_ai("p0i6",[0,"   ADMIN","","",-1,-1,0,"","_self","","","","",0,0,0,"arrow_r.gif","",0,0,0,0,1,"#FA7E02",1,"#FA7E02",1,"","",3,3,0,0,"#FFFFF7","#000000","#FFFFFF","#FFFFFF","bold 14pt Arial Narrow","bold 14pt Arial Narrow",0,0,"","","textura4_4.gif","textura4_4.gif",0,13,30],183,30);
stm_bpx("p2","p1",[]);
stm_aix("p2i0","p1i0",[0,"Profile","","",-1,-1,0,"Profile_.aspx"],90,21);
stm_aix("p2i1","p1i0",[0,"Invoices"],90,21);
stm_aix("p2i2","p1i0",[0,"Reports","","",-1,-1,0,"","_self","","","","",0,0,0,"","",0,0,0,1,1,"#FA7E02",1,"#FA7E02",1],90,21);
stm_ai("p2i3",[0,"Settings","","",-1,-1,0,"","_self","","","","",0,0,0,"arrow_r.gif","",0,0,0,1,1,"#FFFFF7",1,"#FA7E02",0,"textura4_1.gif","textura4_1.gif",3,3,1,1,"#003366 #FA7E02 #FA7E02","#CCCCCC","#FFFFFF","#FFFFFF","bold 11pt Arial Narrow","bold 11pt Arial Narrow",0,0,"","","textura4_3.gif","textura4_3.gif",0,10,21],90,21);
stm_bpx("p3","p1",[]);
stm_aix("p3i0","p1i0",[0,"Roles","","",-1,-1,0,"mroles.aspx"],90,21);
stm_aix("p3i1","p1i0",[0,"Applications","","",-1,-1,0,"mpaplication.aspx"],90,21);
stm_aix("p3i2","p1i0",[0,"Users","","",-1,-1,0,"UserList.aspx"],90,21);
stm_ep();
stm_ep();
stm_aix("p0i7","p0i1",[]);
stm_aix("p0i8","p0i0",[0,"   CHAT","","",-1,-1,0,"chat.aspx","_self","","","","",0,0,0,"","",0,0,0,0,1,"#FA7E02",1,"#FA7E02",1,"","",3,3,0,0,"#FFFFF7","#000000"],183,30);
stm_aix("p0i9","p0i3",[]);
stm_aix("p0i10","p0i8",[0,"   LOG OUT","","",-1,-1,0,"Logout.aspx"],183,30);
stm_ep();
stm_em();
//-->
</script>






</body>
</html>